#include <iostream>
#include <memory>
#include "udp_server.hpp"

using std::cout;
using std::endl;

void useage(const char *str)
{
    cout << "Useage:\n\t" << str << " port\n"
         << endl;
}
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        useage(argv[0]);
        exit(-1);
    }

    uint16_t server_port = atoi(argv[1]);
    //std::string server_ip = argv[1];

    std::unique_ptr<UDPServer> udp_Server(new UDPServer(server_port));
    udp_Server->initServer();
    udp_Server->start();

    return 0;
}